package com.design.patterns.list.factory;

/**
 * 传统模式，在代码中通过语句判断对象初始化。
 * @author Wangzhiwen
 */
public class OrderPizza {

    public static void print(String pizzaName){
        Pizza pizza;

        if ("APizza".equals(pizzaName)){
            pizza = new APizza();
        }else if ("BPizza".equals(pizzaName)){
            pizza = new BPizza();
        }else {
            pizza = new CPizza();
        }

        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();
    }

}
